#!/usr/bin/python
import commands
import simplejson
import urllib  
def cange():
   sc={}
   sc['disk_num'] = commands.getoutput('fdisk -l|grep Disk|wc -l')
   sc['disk_big'] = commands.getoutput("fdisk -l|grep Disk|grep /dev/sdc|awk '{print $3}'")
   f=open('/etc/sysconfig/network')
   line=f.readlines()
   for i in list(line):
     if i.split('=')[0]  == 'HOSTNAME':
         host=i.split('=')[1]
         a=urllib.urlopen('http://XXXXXXXXXX:36000/device/' + host).read()
         ldev = simplejson.loads(a)
         for dev in ldev:
             if dev.has_key('appList'):
                for app in dev['appList']:
                      if app.startswith('CPISF'):
                         sc['type'] = app
         sc['node']= '-'.join(host.split('-')[1:3])
   return sc
